<?php
$this->breadcrumbs = array(
    $this->pageTitle
);
?>
<div class="box">
    <header>
        <div class="icons"><i class="icon-tasks"></i></div>
        <h5><?php echo $this->pageTitle; ?></h5>
    </header>
    <div class="body">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#index">
                    Manage
                </a>
            </li>
            <li>
                <a href="<?php echo url('/node/create', array('type' => $nodeType)) ?>">
                    Add New
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="index">
                <?php
                $this->widget('bootstrap.widgets.TbGridView', array(
                    'dataProvider' => $model->search($nodeType),
                    'type'=>'bordered condensed striped',
                    //'template' => "{items}\n{pager}",
                    'filter' => $model,
                    'columns' => array(
                        array(
                            'name' => 'node_id',
                            'header' => '#',
                            'htmlOptions' => array('width' => '50'),
                        ),
                        'node_title',
                        array(
                            'name' => 'node_status',
                            'header' => 'Status',
                            'type' => 'raw',
                            'value' => '$data->getStatus()',
                            'filter' => Node::getSatusFilter()
                        ),
                        array('name' => 'update_time',
                            'filter' => false,
                            'type' => 'datetime'
                        ),
                        array(
                            //Button Group
                    'header' => 'Action',
                    'value' => function($data) {
                        app()->getController()->widget('bootstrap.widgets.TbButtonGroup', array(
                            'size' => 'mini',
                            'type' => 'inverse', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
                            'buttons' => array(
                                array(
                                    'icon' => 'align-right',
                                    'type' => '',
                                    'items' => array(
                                        array(
                                            'label' => 'Update',
                                            'url' => url('node/update', array('id' => $data->node_id)),
                                        ),
                                        array(
                                            'label' => 'Delete',
                                            'url' => url('node/delete', array('id' => $data->node_id, 'type'=>$data->node_type)),
                                        ),
                                    ),
                                ),
                            ),
                        ));
                    }
                //TbButton Column
//                            'class' => 'bootstrap.widgets.TbButtonColumn',
//                            'htmlOptions' => array('style' => 'width: 50px'),
//                            'template' => '{update}{delete}',
//                            'header' => 'Action',
                        ),
                    ),
                ));
                ?>
            </div>
        </div>
    </div>
</div>